<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

</body>
</html>
<script src="./engine.io.js"></script>
<script>
  	var socket = io('http://localhost:8080');
  	socket.on('event_name', function (data) {
    	console.log(data);//数据
  	});
  	socket.emit('ukdata'); //添加分组
  	socket.on('String', function (data) {
    	console.log(data);
  	});
  	socket.on('connect',function(){
  		console.log('链接成功')
  	});
  	socket.on('disconnect', function() {
	    console.log("与服务其断开");
	});
	socket.on('reconnect', function() {
	    console.log("重新连接到服务器");
	});
	setTimeout(function(){
		socket.close();//关闭链接
	},6000);
</script>